package cn.fzhui;

/**
 * 上网套餐
 * 上网流量、每月资费
 */
public class InternetPackageImpl extends Package implements InternetServiceInterface {

    // 上网流量
    private double internetTraffic;

    public InternetPackageImpl() {
    }

    /**
     * 有参构造
     *
     * @param internetTraffic
     */
    public InternetPackageImpl(double internetTraffic) {
        this.internetTraffic = internetTraffic;
    }

    public double getInternetTraffic() {
        return internetTraffic;
    }

    public void setInternetTraffic(double internetTraffic) {
        this.internetTraffic = internetTraffic;
    }

    /**
     * 显示短信套餐信息
     */
    public void display() {
        System.out.println("上网流量：" + this.internetTraffic);
        System.out.println("每月资费：" + this.tariff);
    }

    @Override
    public void internet(double internetTraffic, Card card) {
        System.out.println("电话卡号：" + card.getNumber() + "使用了上网服务" + internetTraffic + "MB。");
    }
}
